package easy;

import java.util.Arrays;

public class Codility_1 {

	public static void main(String[] args) {
		solution("aba");
	}
	
	private static int solution(String s) {
		int [] pos = new int [s.length() - s.replace(s.charAt(0) + "", "").length()];
		int l = 1, i = 1, max = pos.length;
      
      String [] powerSet = new String[pos.length];
     for(int j = 0; j < pos.length; j++) {
         powerSet[j] = s.substring(pos[j]);
     }
		
		
		while(l < s.length()) {
			if (s.charAt(0) == s.charAt(l))
				pos[i++] = l;
			l++;
		}
		
		String [] subs = new String[s.length()];
		
		for (int j = 0; j < subs.length; j++) {
			subs[j] = s.substring(0, j + 1);
		}

		
		System.out.println(Arrays.toString(pos));
		System.out.println(Arrays.toString(subs));
		
		return max;
	}
}
